﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Maticsoft.Web.Default" %>

<%@ Register src="Header.ascx" tagname="Header" tagprefix="uc1" %>
<%@ Register src="footer.ascx" tagname="footer" tagprefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/img/icon.png" rel="icon" type="images/png" sizes="16*16" />
    <title></title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/common.css" />
    <script src="js/jquery-1.8.2.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/lrtk.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".good-box:nth-child(4n)").css("margin-right", "0");
        });

        function AddShoppingCar(id) {
            $.ajax({
                type: "get",
                url: "ProductDetail.aspx",
                data: "ope=addnum&productId=" + id + "&num=1&lay=&d=" + new Date().toString(),
                success: function (data) {
                    if (data == "1") {
                        alert("添加成功");
                    }
                    else if (data == "-1") {
                        alert("产品已下架");
                    }
                    else if (data == "-2") {
                        alert("库存不足");
                    }
                    else if (data == "-3") {
                        alert("超出购物限额");
                    }
                    else if (data == "-4") {
                        alert("超出购买限额");
                    }
                    else if (data == "-5") {
                        alert("请先登录");
                    }
                    else {
                        alert("添加失败");
                    }
                },
                error: function () {
                    alert("出错啦");
                }
            })
        }	
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <uc1:Header ID="Header1" runat="server" />
    <div class="row bg-white">
        <!--
        <div class="safe_width" id="playBox">
            <div class="pre">
            </div>
            <div class="next">
            </div>
            <div class="smalltitle">
                <ul>
                    <li class="thistitle"></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
            <ul class="oUlplay">
                <asp:Repeater ID="Repeater2" runat="server">
                <ItemTemplate>
                <li><a href="<%#Eval("Url") %>" target="_blank">
                    <img src="/uploadfiles/ads/<%#Eval("pic") %>" alt="<%#Eval("Title") %>" /></a> </li>
                </ItemTemplate>
                </asp:Repeater>
            </ul>
        </div>
        -->
        <div class="banner">
        <script type="text/javascript">
        <!--
            var widths = 998;  //焦点图片宽
            var heights = 420; //焦点图片高
            var show_txt = 0  //0不显示,1显示
            var w = 0;
            var heightt = 0;

            var counts = <%=_AdvNum %>;    //总条数
            //img1=new Image();在这里是声明了一个图片元素的对象
            //后面是对图像的属性进行赋值或设置,如imgs.src="xxxx.jpg"是指定图片的索引地址.
            //这个代码一般用于head区,用于预加载图片,即加快图片显示.
            //只有用new Images()得到的图片IE7才认,
            //而IE6和firefox可认得imgUrl[1]="/y9q9ms7lbgbt.jpg";得到的图片

            <%=_AdvStr %>

            var nn = 1; //当前所显示的滚动图
            var key = 0;  //标识是否为第一次开始执行
            var tt;  //标识作用

            function change_img() {
                if (key == 0) { key = 1; } //如果第一次执行KEY=1，表示已经执行过一次了。
                else if (document.all)//document.all仅IE6/7认识，firefox不会执行此段内容
                {
                    document.getElementById("picaaa").filters[0].Apply(); //将滤镜应用到对像上
                    document.getElementById("picaaa").filters[0].Play(duration = 2);  //开始转换
                    document.getElementById("picaaa").filters[0].Transition = 23; //转换效果
                }

                eval('document.getElementById("picaaa").src=img' + nn + '.src');   //替换图片
                eval('document.getElementById("urlaaa").href=url' + nn + '.src'); //替换URL
                eval('document.getElementById("titleaaa").innerHTML=txt' + nn + '.txt'); //替换ALT 

                for (var i = 1; i <= counts; i++) {
                    document.getElementById("xxjdjj" + i).className = 'axx';   //将下面黑条上的所有链接变为未选中状态
                }
                document.getElementById("xxjdjj" + nn).className = 'bxx';    //将当前页面的ID设置为选中状态
                nn++;
                if (nn > counts) { nn = 1; }  //如果ID大于总图片数量。则从头开始循环
                tt = setTimeout('change_img()', 5000);  //在4秒后重新执行change_img()方法.
            }
            function changeimg(n)//点击黑条上的链接执行的方法。
            {
                nn = n; //当前页面的ID等于传入的N值,
                window.clearInterval(tt); //清除用于循环的TT
                //重新执行change_img();但change_img()内所调用的图片ID已经在此处被修改,会从新ID处开始执行.
                change_img();
            }
            //样式表
            document.write('<style>');
            document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;font-size:12px;}');
            document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
            document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
            document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
            document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#ff0000;}');
            document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#ff0000;}');
            document.write('</style>');
            //内容部分
            document.write('<div style="width:' + widths + 'px; margin:0px auto;">');
            document.write('<div style="width:' + widths + 'px;height:' + heights + 'px;overflow:hidden;text-overflow:clip;float:left;">');
            document.write('<div><a id="urlaaa" target="_blank"><img id="picaaa" style="border:0px #cbcbcb solid;FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=2,transition=23)" width=' + widths + ' height=' + heights + ' /></a></div>');
            document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=90);background: #888888;width:100%-10px;text-align:right;top:-14px;position:relative;margin:0px;height:14px;border:0px;padding-top:1px;z-index:1;display:none;"><div>');
            for (var i = 1; i < counts + 1; i++) {
                document.write('<a href="javascript:changeimg(' + i + ');" id="xxjdjj' + i + '" class="axx" target="_self">' + i + '</a>');
            }
            document.write('</div></div></div>');
            //说明文字
            document.write('<div id="titleaaa" style="width:' + widths + 'px;overflow:hidden;display:' + (show_txt == 1 ? "" : "none") + ';font-size:12px; text-align:center; margin:0px;padding:2px 0px;"></div>');
            //document.write('<div id="titleaaa" style="width:'+widths+'px;overflow:hidden;display:'+(show_txt==1 ? "" : "none")+';"><input id="titleaaa" type="txt" style="height:24px;line-height:24px;background-color:#006ead;border:0px;width:'+widths+'px;color:#fff;font-size:9pt;position:relative;text-align:center;"></div>');
            document.write('</div>');
            //开始执行滚动操作
            change_img();

        //-->
        </script>
        </div>
    </div>
    <div class="row bg-white">
        <div class="safe_width">
            <div class="box-tit">
                <p class="fl fs-18 tc-black fb">
                    热门产品</p>
                <a class="fr fs-16 tc-black" href="ProductListNew.aspx">更多》</a>
                 <div style="background-color:#ccc;height:1px; width:100%; margin-top:25px"></div>
            </div>
            <div class="box-good">
                <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                <div class="good-box">
                    
                        <div class="good-img">
                            <a href="ProductDetail.aspx?cid=<%#Eval("categoryId") %>&id=<%#Eval("productId") %>"><img src="uploadpic/<%#Eval("pic") %>"></a>
                        </div>
                        <div class="good-des">
                            <p class="good-name">
                                <%#Eval("ProductName")%></p>
                            <div class="goods-buy">
                                <p class="fl">
                                    <span class="fs-16">￥</span><%# decimal.Parse(Eval("SalePrice").ToString()).ToString("f2")%></p>
                                <a href="###" class="fr" onclick="AddShoppingCar(<%#Eval("ProductId") %>)" style="display:none">加入购物车</a>
                            </div>
                        </div>
                </div>
                </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
        <div class="safe_width">
            <div class="box-tit">
                <p class="fl fs-18 tc-black fb">
                    个人护理</p>
                <a class="fr fs-16 tc-black" href="ProductList.aspx?cid=3">更多》</a>
                 <div style="background-color:#ccc;height:1px; width:100%; margin-top:25px"></div>
            </div>
            <div class="box-good">
                <asp:Repeater ID="RepeaterP3" runat="server">
                <ItemTemplate>
                <div class="good-box">
                    
                        <div class="good-img">
                            <a href="ProductDetail.aspx?cid=<%#Eval("categoryId") %>&id=<%#Eval("productId") %>"><img src="uploadpic/<%#Eval("pic") %>"></a>
                        </div>
                        <div class="good-des">
                            <p class="good-name">
                                <%#Eval("ProductName")%></p>
                            <div class="goods-buy">
                                <p class="fl">
                                    <span class="fs-16">￥</span><%# decimal.Parse(Eval("SalePrice").ToString()).ToString("f2")%></p>
                                <a href="###" class="fr" onclick="AddShoppingCar(<%#Eval("ProductId") %>)" style="display:none">加入购物车</a>
                            </div>
                        </div>
                </div>
                </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
        <div class="safe_width">
            <div class="box-tit">
                <p class="fl fs-18 tc-black fb">
                    婴儿用品</p>
                <a class="fr fs-16 tc-black" href="ProductList.aspx?cid=2">更多》</a>
                 <div style="background-color:#ccc;height:1px; width:100%; margin-top:25px"></div>
            </div>
            <div class="box-good">
                <asp:Repeater ID="RepeaterP2" runat="server">
                <ItemTemplate>
                <div class="good-box">
                    
                        <div class="good-img">
                            <a href="ProductDetail.aspx?cid=<%#Eval("categoryId") %>&id=<%#Eval("productId") %>"><img src="uploadpic/<%#Eval("pic") %>"></a>
                        </div>
                        <div class="good-des">
                            <p class="good-name">
                                <%#Eval("ProductName")%></p>
                            <div class="goods-buy">
                                <p class="fl">
                                    <span class="fs-16">￥</span><%# decimal.Parse(Eval("SalePrice").ToString()).ToString("f2")%></p>
                                <a href="###" class="fr" onclick="AddShoppingCar(<%#Eval("ProductId") %>)" style="display:none">加入购物车</a>
                            </div>
                        </div>
                </div>
                </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
        <div class="safe_width">
            <div class="box-tit">
                <p class="fl fs-18 tc-black fb">
                    家居生活</p>
                <a class="fr fs-16 tc-black" href="ProductList.aspx?cid=1">更多》</a>
                 <div style="background-color:#ccc;height:1px; width:100%; margin-top:25px"></div>
            </div>
            <div class="box-good">
                <asp:Repeater ID="RepeaterP1" runat="server">
                <ItemTemplate>
                <div class="good-box">
                    
                        <div class="good-img">
                            <a href="ProductDetail.aspx?cid=<%#Eval("categoryId") %>&id=<%#Eval("productId") %>"><img src="uploadpic/<%#Eval("pic") %>"></a>
                        </div>
                        <div class="good-des">
                            <p class="good-name">
                                <%#Eval("ProductName")%></p>
                            <div class="goods-buy">
                                <p class="fl">
                                    <span class="fs-16">￥</span><%# decimal.Parse(Eval("SalePrice").ToString()).ToString("f2")%></p>
                                <a href="###" class="fr" onclick="AddShoppingCar(<%#Eval("ProductId") %>)" style="display:none">加入购物车</a>
                            </div>
                        </div>
                </div>
                </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
    </div>
    <uc2:footer ID="footer1" runat="server" />
    </form>
</body>
</html>
